<template>
  <Dialog :title="dialogTitle" v-model="dialogVisible">
    <el-button type="primary" @click="getObtain" v-if="formType==='create'">{{ t('common.ObtainESIC') }}</el-button>

    <el-form
      ref="formRef"
      :model="formData"
      :rules="formRules"
      label-width="auto"
      v-loading="formLoading"
      style="margin-top: 10px"
    >
      <el-row :gutter="20">
        <!--左侧块------------------------------------------------------------->
        <el-col :span="12">
          <el-form-item :label="t('formData.wellName')" prop="wellName">
            <el-input
              v-model="formData.wellName"
              :placeholder="t('formData.wellNameInfo')"
              :disabled="
                clicks && ESICValue.wellName !== null && ESICValue.wellName !== undefined
                  ? true
                  : false
              "
            />
          </el-form-item>

          <el-form-item :label="t('formData.wellType')" prop="wellType">
            <el-select
              v-model="formData.wellType"
              :placeholder="t('formData.wellTypeInfo')"
              :disabled="
                clicks && ESICValue.wellTypeName !== null && ESICValue.wellTypeName !== undefined
                  ? true
                  : false
              "
            >
              <el-option
                v-for="dict in getStrDictOptions(DICT_TYPE.WELL_TYPE)"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>

          <el-form-item :label="t('formData.oilField')" prop="oilField">
            <el-input
              v-model="formData.oilField"
              :placeholder="t('formData.oilFieldInfo')"
              :disabled="
                clicks && ESICValue.oilFieldName !== null && ESICValue.oilFieldName !== undefined
                  ? true
                  : false
              "
            />
          </el-form-item>

          <el-form-item :label="t('formData.Longitude')" prop="longitude">
            <el-input
              v-model="formData.longitude"
              :placeholder="t('formData.LongitudeInfo')"
              :disabled="
                clicks && ESICValue.designLongitude !== null && ESICValue.designLongitude !== undefined
                  ? true
                  : false
              "
            />
          </el-form-item>

          <el-form-item :label="t('formData.drillingDate')" prop="drillingDate">
            <el-date-picker
              v-model="formData.drillingDate"
              type="date"
              :placeholder="t('formData.drillingDateInfo')"
              value-format="YYYY-MM-DD"
              :disabled="
                clicks && ESICValue.drillingDate !== null && ESICValue.drillingDate !== undefined
                  ? true
                  : false
              "
            />
          </el-form-item>

          <el-form-item :label="t('formData.contactPerson')" prop="contactPerson">
            <el-input
              v-model="formData.contactPerson"
              :placeholder="t('formData.contactPersonInfo')"
              :disabled="
                clicks && ESICValue.userName !== null && ESICValue.userName !== undefined
                  ? true
                  : false
              "
            />
          </el-form-item>
        </el-col>
        <!--右侧块------------------------------------------------------------->
        <el-col :span="12">
          <!-- <el-form-item :label="t('formData.wellId')" prop="wellId">
            <el-input
              v-model="formData.wellId"
              :placeholder="t('formData.wellIdInfo')"
              :disabled="
                clicks && ESICValue.wellId !== null && ESICValue.wellId !== undefined ? true : false
              "
            />
          </el-form-item> -->

          <el-form-item :label="t('formData.wellCategory')" prop="wellCategory">
            <el-select
              v-model="formData.wellCategory"
              :placeholder="t('formData.wellTypeInfo')"
              :disabled="
                clicks && ESICValue.wellSortName !== null && ESICValue.wellSortName !== undefined
                  ? true
                  : false
              "
            >
              <el-option
                v-for="dict in getStrDictOptions(DICT_TYPE.WELL_CATEGORY)"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>

          <el-form-item :label="t('formData.oilFieldBlock')" prop="oilFieldBlock">
            <el-select
              v-model="formData.oilFieldBlock"
              :placeholder="t('formData.oilFieldBlockInfo')"
              :disabled="
                clicks && ESICValue.oilFieldBlockName !== null && ESICValue.oilFieldBlockName !== undefined
                  ? true
                  : false
              "
            >
              <el-option
                v-for="dict in getStrDictOptions(DICT_TYPE.BLOCK)"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>

          <el-form-item :label="t('formData.Latitude')" prop="latitude">
            <el-input
              v-model="formData.latitude"
              :placeholder="t('formData.LatitudeInfo')"
              :disabled="
                clicks && ESICValue.designLatitude !== null && ESICValue.designLatitude !== undefined
                  ? true
                  : false
              "
            />
          </el-form-item>

          <el-form-item :label="t('formData.designWellde')" prop="designWellde">
            <el-input
              v-model="formData.designWellde"
              :placeholder="t('formData.designWelldeInfo')"
              :disabled="
                clicks && ESICValue.designWellde !== null && ESICValue.designWellde !== undefined
                  ? true
                  : false
              "
            />
          </el-form-item>

          <el-form-item :label="t('formData.contactPhone')" prop="contactPhone">
            <el-input
              v-model="formData.contactPhone"
              :placeholder="t('formData.contactPhoneInfo')"
              :disabled="
                clicks && ESICValue.contactPhone !== null && ESICValue.contactPhone !== undefined
                  ? true
                  : false
              "
            />
          </el-form-item>
        </el-col>
      </el-row>

      <!--      <el-form-item label="国家" prop="country">
        <el-input v-model="formData.country" placeholder="请输入国家" />
      </el-form-item>
      <el-form-item label="省" prop="province">
        <el-input v-model="formData.province" placeholder="请输入省" />
      </el-form-item>
      <el-form-item label="市" prop="city">
        <el-input v-model="formData.city" placeholder="请输入市" />
      </el-form-item>
      <el-form-item label="县" prop="county">
        <el-input v-model="formData.county" placeholder="请输入县" />
      </el-form-item>-->

      <el-form-item :label="t('formItems.location')" prop="addressId">
        <el-cascader
          v-model="selectedAddress"
          :options="addressDataTree"
          clearable
          @change="addressChanges"
          :props="{ label: 'name', value: 'id', children: 'children' }"
          :placeholder="t('formItems.locationPlaceholder')"
        />
      </el-form-item>

      <el-form-item :label="t('formData.remark')" prop="remark">
        <el-input
          v-model="formData.remark"
          type="textarea"
          :rows="4"
          :placeholder="t('formData.remarkInfo')"
        />
      </el-form-item>
    </el-form>
    <template #footer>
      <el-button @click="submitForm" type="primary" :disabled="formLoading">
        {{ t('action.confirm') }}
      </el-button>
      <el-button @click="dialogVisible = false">
        {{ t('action.cancel') }}
      </el-button>
    </template>
  </Dialog>
  <Dialog :title="t('common.ObtainESIC')" v-model="dialogVisibleable" width="1500px">
    <el-table :data="datas" @current-change="handleCurrentChange">
      <el-table-column :label="t('formData.wellName')" prop="wellName" />
      <el-table-column :label="t('formData.wellType')" prop="wellTypeName" />
      <el-table-column :label="t('formData.oilField')" prop="oilFieldName" />
      <el-table-column :label="t('formData.Longitude')" prop="designLongitude" />
      <el-table-column :label="t('formData.Latitude')" prop="designLatitude" />
      <el-table-column :label="t('formData.drillingDate')" prop="createDateShow" />
      <el-table-column :label="t('formData.contactPerson')" prop="userName" />
      <el-table-column :label="t('formData.wellId')" prop="wellId" />
      <el-table-column :label="t('formData.wellCategory')" prop="wellSortName" />
      <el-table-column :label="t('formData.oilFieldBlock')" prop="oilFieldBlockName" />
      <el-table-column :label="t('formData.designWellde')" prop="designWellde" />
      <el-table-column :label="t('formData.contactPhone')" prop="contactPhone" />
      <el-table-column :label="t('formData.location')">
        <template #default="scope">{{ scope.row.provinceName }}{{ scope.row.cityName }}</template>
      </el-table-column>
      <el-table-column :label="t('formData.remark')" prop="remark" />
    </el-table>
  </Dialog>
</template>
<script setup lang="ts">
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import { SiteApi, SiteVO } from '@/api/base/site'
import { defaultProps } from '@/utils/tree'
import { reactive } from 'vue'
import { ElMessage, ElTable } from 'element-plus'
/** 现场 表单 */
defineOptions({ name: 'SiteForm' })

const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
const clicks = ref(false)
const dialogVisible = ref(false) // 弹窗的是否展示
const dialogVisibleable = ref(false) // 弹窗的是否展示
const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 表单的加载中：1）修改时的数据加载；2）提交的按钮禁用
const formType = ref('') // 表单的类型：create - 新增；update - 修改
const formData = ref({
  id: undefined,
  wellId: undefined,
  wellName: undefined,
  wellType: undefined,
  wellCategory: undefined,
  oilField: undefined,
  oilFieldBlock: undefined,
  longitude: undefined,
  latitude: undefined,
  aimLayer: undefined,
  drillingDate: undefined,
  designWellde: undefined,
  drillingWellde: undefined,
  drillingLayer: undefined,
  welldeLithology: undefined,
  projectProfile: undefined,
  contactPerson: undefined,
  contactPhone: undefined,
  remark: undefined,
  state: undefined,
  country: undefined,
  province: undefined,
  city: undefined,
  county: undefined,
  addressId: undefined
})
const datas = ref([
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '20221209C5000000000004T0002',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: null,
    terrainLandforms: null,
    jzh: null,
    wellName: '阳101H25-1',
    horizontalLength: null,
    oilFieldBlock: '0300100011000005002',
    angleDip: null,
    keyWellLevel: '0300100008000000005',
    designLatitude: null,
    casingTopDepth: 0,
    geographPosition: null,
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: null,
    oilField: '0100100014000000639',
    actualXAxis: null,
    designLongitude: null,
    wellFieldUnitName: null,
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '采气井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: null,
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 07:31:23',
    structureLocation: null,
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: 'US-HMT',
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: '正常',
    terraceCode: null,
    remark: null,
    actualYAxis: null,
    drllPurpose: null,
    wellType: '0300100002000000012',
    cityName: '美国-赫米特',
    designYAxis: null,
    wellUwi: null,
    oilFieldName: '西南油气田勘探事业部',
    bushingElevation: null,
    wellId: '20221209C5000000000004T0002',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: '平台井组名3232',
    createDate: '2024-01-01 07:31:23',
    countyName: null,
    wellTypeName: '水平井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000012',
    updateUser: 'qukejiang@cnpc.com.cn',
    traverseLineXAxis: null,
    userName: '王璐',
    wellLegalName: null,
    oilFieldBlockName: '四川盆地泸州区块',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'YANG101H25-1',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: '10',
    siteId: '0300100011000000245',
    createUser: '4806d51a21cc4b108c4b16fd8f5b9b69',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202401010737127985520301',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: '330000',
    terrainLandforms: null,
    jzh: null,
    wellName: '太144-斜66',
    horizontalLength: null,
    oilFieldBlock: '0300100011000008057',
    angleDip: null,
    keyWellLevel: null,
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: 0,
    oilField: '0100100014000000002',
    actualXAxis: 0,
    designLongitude: null,
    wellFieldUnitName: null,
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '开发井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: '浙江省',
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 07:37:12',
    structureLocation: null,
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: '330200',
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: null,
    terraceCode: null,
    remark: '20240625更新国家中国为编码;20240411大庆批量修改甲方单位;',
    actualYAxis: 0,
    drllPurpose: null,
    wellType: '0300100002000000004',
    cityName: '宁波市',
    designYAxis: 123,
    wellUwi: null,
    oilFieldName: '大庆油田',
    bushingElevation: null,
    wellId: '202401010737127985520301',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 07:37:12',
    countyName: null,
    wellTypeName: '定向井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000010',
    updateUser: 'qukejiang@cnpc.com.cn',
    traverseLineXAxis: null,
    userName: null,
    wellLegalName: null,
    oilFieldBlockName: '七厂2021葡47',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'TAI144-XIE66',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000000238',
    createUser: 'e896553497784f938070e4f719ca7932',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202401010737152791476230',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: null,
    terrainLandforms: null,
    jzh: null,
    wellName: '太144-斜68',
    horizontalLength: null,
    oilFieldBlock: '0300100011000008057',
    angleDip: null,
    keyWellLevel: null,
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: 0,
    oilField: '0100100014000000002',
    actualXAxis: 0,
    designLongitude: null,
    wellFieldUnitName: null,
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '开发井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: null,
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 07:37:16',
    structureLocation: null,
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: null,
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: null,
    terraceCode: null,
    remark: '20240625更新国家中国为编码;20240411大庆批量修改甲方单位;',
    actualYAxis: 0,
    drllPurpose: null,
    wellType: '0300100002000000015',
    cityName: null,
    designYAxis: 0,
    wellUwi: null,
    oilFieldName: '大庆油田',
    bushingElevation: null,
    wellId: '202401010737152791476230',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 07:37:16',
    countyName: null,
    wellTypeName: '其它井型',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000010',
    updateUser: 'e896553497784f938070e4f719ca7932',
    traverseLineXAxis: null,
    userName: null,
    wellLegalName: null,
    oilFieldBlockName: '七厂2021葡47',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'TAI144-XIE68',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000000238',
    createUser: 'e896553497784f938070e4f719ca7932',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202401010749172815322256',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: null,
    terrainLandforms: null,
    jzh: null,
    wellName: '南2-丁3-斜P3131',
    horizontalLength: null,
    oilFieldBlock: '0300100011000008222',
    angleDip: null,
    keyWellLevel: null,
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: 0,
    oilField: '0100100014000000002',
    actualXAxis: 0,
    designLongitude: null,
    wellFieldUnitName: null,
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '调整井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: null,
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 07:49:17',
    structureLocation: null,
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: null,
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: null,
    terraceCode: null,
    remark: '20240625更新国家中国为编码;20240411大庆批量修改甲方单位;',
    actualYAxis: 0,
    drllPurpose: null,
    wellType: '0300100002000000004',
    cityName: null,
    designYAxis: 0,
    wellUwi: null,
    oilFieldName: '大庆油田',
    bushingElevation: null,
    wellId: '202401010749172815322256',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 07:49:17',
    countyName: null,
    wellTypeName: '定向井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000050',
    updateUser: 'e896553497784f938070e4f719ca7932',
    traverseLineXAxis: null,
    userName: null,
    wellLegalName: null,
    oilFieldBlockName: '二厂南二区东部南块',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'NAN2-DING3-XIEP3131',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000000238',
    createUser: 'e896553497784f938070e4f719ca7932',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '20230915C8000000000158T0005',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: null,
    terrainLandforms: null,
    jzh: null,
    wellName: 'BZ34-9-B3S1',
    horizontalLength: null,
    oilFieldBlock: '0300100011000002518',
    angleDip: null,
    keyWellLevel: '0300100008000000005',
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: null,
    oilField: '0100100014140805224',
    actualXAxis: null,
    designLongitude: null,
    wellFieldUnitName: null,
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '采油井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: null,
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 08:43:44',
    structureLocation:
      '明下段砂体具有多套油水系统，受构造形态、岩性和断层控制，油藏类型主要为岩性-构造油藏。驱动类型以边水驱和人工水驱为主。',
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: null,
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: '正常',
    terraceCode: null,
    remark: null,
    actualYAxis: null,
    drllPurpose: null,
    wellType: '0300100002000000024',
    cityName: null,
    designYAxis: null,
    wellUwi: null,
    oilFieldName: '中海油天津分公司',
    bushingElevation: null,
    wellId: '20230915C8000000000158T0005',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 08:43:44',
    countyName: null,
    wellTypeName: '大斜度井(单井)',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000059',
    updateUser: '5afde4dfd20340e8865d54e9aa8013c0',
    traverseLineXAxis: null,
    userName: '孔令锋',
    wellLegalName: null,
    oilFieldBlockName: '渤中34-5油田',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'BZ34-9-B3S1',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000002511',
    createUser: '5afde4dfd20340e8865d54e9aa8013c0',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202312281546397579087026',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: null,
    terrainLandforms: null,
    jzh: null,
    wellName: '南2-丁3-斜P3133',
    horizontalLength: null,
    oilFieldBlock: '0300100011000008222',
    angleDip: -11.33,
    keyWellLevel: null,
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: 18937.53,
    oilField: '0100100014000000002',
    actualXAxis: 0,
    designLongitude: null,
    wellFieldUnitName: 'dq',
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '调整井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: null,
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 08:57:36',
    structureLocation: null,
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: null,
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: null,
    terraceCode: '1',
    remark: '20240625更新国家中国为编码;20240411大庆批量修改甲方单位;',
    actualYAxis: 0,
    drllPurpose: null,
    wellType: '0300100002000000004',
    cityName: null,
    designYAxis: 47163.09,
    wellUwi: null,
    oilFieldName: '大庆油田',
    bushingElevation: null,
    wellId: '202312281546397579087026',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 08:57:36',
    countyName: null,
    wellTypeName: '定向井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000050',
    updateUser: 'From_DQ',
    traverseLineXAxis: null,
    userName: null,
    wellLegalName: null,
    oilFieldBlockName: '二厂南二区东部南块',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'NAN2-DING3-XIEP3133',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000000238',
    createUser: 'From_DQ',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202312061038240204765631',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: '花33区块位于大情字井油田西坡，整体构造形态为由北西向南东倾没的单斜构造',
    province: null,
    terrainLandforms: null,
    jzh: null,
    wellName: '花33-5-6',
    horizontalLength: null,
    oilFieldBlock: '0300100011000000522',
    angleDip: -10,
    keyWellLevel: null,
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: '大情字井油田位于吉林省乾安县境内，北距乾安县城约30km，南距长岭县城约70km。',
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: 21570725.65,
    oilField: '0100100014000000152',
    actualXAxis: 0,
    designLongitude: null,
    wellFieldUnitName: 'jl',
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '其它开发井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: null,
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 09:01:35',
    structureLocation: '大情字井油田位于吉林省乾安县境内，北距乾安县城约30km，南距长岭县城约70km。',
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: null,
    meteoroData: null,
    magneticFieldintensity: 0,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: null,
    terraceCode: '0',
    remark: '20240625更新国家中国为编码;',
    actualYAxis: 0,
    drllPurpose: null,
    wellType: '0300100002000000004',
    cityName: null,
    designYAxis: 4977594.38,
    wellUwi: null,
    oilFieldName: '乾安采油厂',
    bushingElevation: 141.75,
    wellId: '202312061038240204765631',
    magneticDip: 0,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 09:01:35',
    countyName: null,
    wellTypeName: '定向井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000015',
    updateUser: 'From_DQ',
    traverseLineXAxis: null,
    userName: null,
    wellLegalName: null,
    oilFieldBlockName: '乾安油气田',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'HUA33-5-6',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000000239',
    createUser: 'From_DQ',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202401010948190999507486',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: null,
    terrainLandforms: null,
    jzh: null,
    wellName: '杜212-55-301(大修后)',
    horizontalLength: null,
    oilFieldBlock: '0300100011000000184',
    angleDip: null,
    keyWellLevel: '0300100008000000005',
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: null,
    oilField: '0100100014000000134',
    actualXAxis: null,
    designLongitude: null,
    wellFieldUnitName: null,
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '采油井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: null,
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 09:48:19',
    structureLocation: null,
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: null,
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: '正常',
    terraceCode: null,
    remark: null,
    actualYAxis: null,
    drllPurpose: null,
    wellType: '0300100002000000005',
    cityName: null,
    designYAxis: null,
    wellUwi: null,
    oilFieldName: '曙光采油厂',
    bushingElevation: null,
    wellId: '202401010948190999507486',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 09:48:19',
    countyName: null,
    wellTypeName: '定向井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000059',
    updateUser: 'lh0210000337',
    traverseLineXAxis: null,
    userName: '李晓唐',
    wellLegalName: null,
    oilFieldBlockName: '曙光油气田',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'DU212-55-301(DAXIUHOU)',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000000252',
    createUser: 'lh0210000337',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202311270939086229137039',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: '松辽盆地南部中央坳陷区红岗阶地海坨子构造',
    province: null,
    terrainLandforms: null,
    jzh: null,
    wellName: '海118-14-12',
    horizontalLength: null,
    oilFieldBlock: '0300100011000000522',
    angleDip: -10,
    keyWellLevel: null,
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: '吉林省西部乾安县境内',
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: 21571003.36,
    oilField: '0100100014000000152',
    actualXAxis: 0,
    designLongitude: null,
    wellFieldUnitName: 'jl',
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '其它开发井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: null,
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 10:29:31',
    structureLocation: '松辽盆地南部中央坳陷区红岗阶地海坨子构造',
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: null,
    meteoroData: null,
    magneticFieldintensity: 0,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: null,
    terraceCode: '0',
    remark: '20240625更新国家中国为编码;',
    actualYAxis: 0,
    drllPurpose: null,
    wellType: '0300100002000000004',
    cityName: null,
    designYAxis: 5002161.24,
    wellUwi: null,
    oilFieldName: '乾安采油厂',
    bushingElevation: 138.14,
    wellId: '202311270939086229137039',
    magneticDip: 0,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 10:29:31',
    countyName: null,
    wellTypeName: '定向井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000015',
    updateUser: 'From_DQ',
    traverseLineXAxis: null,
    userName: null,
    wellLegalName: null,
    oilFieldBlockName: '乾安油气田',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'HAI118-14-12',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000000239',
    createUser: 'From_DQ',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202401011040120367784909',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: '220000',
    terrainLandforms: null,
    jzh: null,
    wellName: '西2-014.41',
    horizontalLength: null,
    oilFieldBlock: '0300100011000000586',
    angleDip: null,
    keyWellLevel: '0300100008000000005',
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: null,
    oilField: '0100100014000000155',
    actualXAxis: null,
    designLongitude: null,
    wellFieldUnitName: null,
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '开发井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: '吉林省',
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 10:40:12',
    structureLocation: null,
    relativeSpace: null,
    updateDate: '2024-09-19 16:54:59',
    relativeWellName: null,
    city: '220700',
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: '正常',
    terraceCode: null,
    remark: null,
    actualYAxis: null,
    drllPurpose: null,
    wellType: '0300100002000000004',
    cityName: '松原市',
    designYAxis: null,
    wellUwi: null,
    oilFieldName: '扶余采油厂',
    bushingElevation: null,
    wellId: '202401011040120367784909',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 10:40:12',
    countyName: null,
    wellTypeName: '定向井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000010',
    updateUser: '509029c8c3ff41fbb412c183dd07252d',
    traverseLineXAxis: null,
    userName: '刘强',
    wellLegalName: null,
    oilFieldBlockName: '扶余油气田',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'XI2-014.41',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000000239',
    createUser: '509029c8c3ff41fbb412c183dd07252d',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202401011044305652975541',
    everWellName: null,
    sectionNumber: null,
    county: '0200100002000001296',
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: '220000',
    terrainLandforms: null,
    jzh: null,
    wellName: '吉14-3.2',
    horizontalLength: null,
    oilFieldBlock: '0300100011000000576',
    angleDip: null,
    keyWellLevel: '0300100008000000005',
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: null,
    oilField: '0100100014000000154',
    actualXAxis: null,
    designLongitude: null,
    wellFieldUnitName: null,
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '采油井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: '吉林省',
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 10:44:30',
    structureLocation: null,
    relativeSpace: null,
    updateDate: '2024-09-19 16:54:59',
    relativeWellName: null,
    city: '220700',
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: '正常',
    terraceCode: null,
    remark: null,
    actualYAxis: null,
    drllPurpose: null,
    wellType: '0300100002000000005',
    cityName: '松原市',
    designYAxis: null,
    wellUwi: null,
    oilFieldName: '新立采油厂',
    bushingElevation: null,
    wellId: '202401011044305652975541',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 10:44:30',
    countyName: '前郭尔罗斯蒙古族自治县',
    wellTypeName: '定向井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000011',
    updateUser: '509029c8c3ff41fbb412c183dd07252d',
    traverseLineXAxis: null,
    userName: '刘强',
    wellLegalName: null,
    oilFieldBlockName: '新立油气田',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'JI14-3.2',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000000239',
    createUser: '509029c8c3ff41fbb412c183dd07252d',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202401011046218726349134',
    everWellName: null,
    sectionNumber: null,
    county: '0200100002000001296',
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: '220000',
    terrainLandforms: null,
    jzh: null,
    wellName: '吉8-01',
    horizontalLength: null,
    oilFieldBlock: '0300100011000000576',
    angleDip: null,
    keyWellLevel: '0300100008000000005',
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: null,
    oilField: '0100100014000000154',
    actualXAxis: null,
    designLongitude: null,
    wellFieldUnitName: null,
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '采油井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: '吉林省',
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 10:46:21',
    structureLocation: null,
    relativeSpace: null,
    updateDate: '2024-09-19 16:54:59',
    relativeWellName: null,
    city: '220700',
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: '正常',
    terraceCode: null,
    remark: null,
    actualYAxis: null,
    drllPurpose: null,
    wellType: '0300100002000000005',
    cityName: '松原市',
    designYAxis: null,
    wellUwi: null,
    oilFieldName: '新立采油厂',
    bushingElevation: null,
    wellId: '202401011046218726349134',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 10:46:21',
    countyName: '前郭尔罗斯蒙古族自治县',
    wellTypeName: '定向井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000059',
    updateUser: '509029c8c3ff41fbb412c183dd07252d',
    traverseLineXAxis: null,
    userName: '刘强',
    wellLegalName: null,
    oilFieldBlockName: '新立油气田',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'JI8-01',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000000239',
    createUser: '509029c8c3ff41fbb412c183dd07252d',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '6122431216',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: '四级',
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: '成都—简阳',
    province: null,
    terrainLandforms: null,
    jzh: null,
    wellName: '永浅108',
    horizontalLength: null,
    oilFieldBlock: '0300100011000002166',
    angleDip: null,
    keyWellLevel: '0300100008000000005',
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: '四川省成都市金堂县高板社区三岔河村 10 组',
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: 3390572.29,
    oilField: '0100100014000000348',
    actualXAxis: 3390572.29,
    designLongitude: null,
    wellFieldUnitName: '西南油气田',
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '探井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: null,
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 11:31:01',
    structureLocation: '四川盆地天府气田简阳地区单斜构造',
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: null,
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: '四川盆地天府气田简阳地区单斜构造',
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: '正常',
    terraceCode: null,
    remark: null,
    actualYAxis: 18461983.71,
    drllPurpose: null,
    wellType: '0300100002000000001',
    cityName: null,
    designYAxis: 18461983.71,
    wellUwi: null,
    oilFieldName: '川中油气矿',
    bushingElevation: null,
    wellId: 'WELLXN110000963',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 11:31:01',
    countyName: null,
    wellTypeName: '直井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000001',
    updateUser: 'b210c45fccd948d7b206f9607c67bce1',
    traverseLineXAxis: null,
    userName: null,
    wellLegalName: null,
    oilFieldBlockName: '磨溪',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: '高含硫',
    wellEnName: 'YONGQIAN108',
    wellctrlRiskLevel: '1200101002000000001',
    wellctrlRiskType: '6000000138000000002',
    wellBelongRegion: null,
    siteId: '0300100011000000245',
    createUser: '陈泠佑',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202401011313512151142580',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: null,
    terrainLandforms: null,
    jzh: null,
    wellName: '拜Z7-L1',
    horizontalLength: null,
    oilFieldBlock: '0300100011000008231',
    angleDip: null,
    keyWellLevel: null,
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: 0,
    oilField: '0100100014140806002',
    actualXAxis: 0,
    designLongitude: null,
    wellFieldUnitName: null,
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '开发井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: null,
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 13:13:53',
    structureLocation: null,
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: null,
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: null,
    terraceCode: null,
    remark: '20240625更新国家中国为编码;20240411大庆批量修改甲方单位;',
    actualYAxis: 0,
    drllPurpose: null,
    wellType: '0300100002000000011',
    cityName: null,
    designYAxis: 0,
    wellUwi: null,
    oilFieldName: '新疆亚新煤层气投资开发（集团）有限责任公司',
    bushingElevation: null,
    wellId: '202401011313512151142580',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 13:13:53',
    countyName: null,
    wellTypeName: '水平井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000010',
    updateUser: 'e896553497784f938070e4f719ca7932',
    traverseLineXAxis: null,
    userName: null,
    wellLegalName: null,
    oilFieldBlockName: '拜城中区',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'BAIZ7-L1',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000000238',
    createUser: 'e896553497784f938070e4f719ca7932',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202312311533376510901137',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: null,
    terrainLandforms: null,
    jzh: null,
    wellName: '南2-丁3-P3130',
    horizontalLength: null,
    oilFieldBlock: '0300100011000008222',
    angleDip: -11.33,
    keyWellLevel: null,
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: 18205.13,
    oilField: '0100100014000000002',
    actualXAxis: 0,
    designLongitude: null,
    wellFieldUnitName: 'dq',
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '调整井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: null,
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 13:20:29',
    structureLocation: null,
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: null,
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: null,
    terraceCode: '1',
    remark: '20240625更新国家中国为编码;20240411大庆批量修改甲方单位;',
    actualYAxis: 0,
    drllPurpose: null,
    wellType: '0300100002000000001',
    cityName: null,
    designYAxis: 47261.93,
    wellUwi: null,
    oilFieldName: '大庆油田',
    bushingElevation: null,
    wellId: '202312311533376510901137',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 13:20:29',
    countyName: null,
    wellTypeName: '直井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000050',
    updateUser: 'From_DQ',
    traverseLineXAxis: null,
    userName: null,
    wellLegalName: null,
    oilFieldBlockName: '二厂南二区东部南块',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'NAN2-DING3-P3130',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000000238',
    createUser: 'From_DQ',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202312311531173070962870',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: null,
    terrainLandforms: null,
    jzh: null,
    wellName: '南2-丁20-斜P3032',
    horizontalLength: null,
    oilFieldBlock: '0300100011000008222',
    angleDip: -11.33,
    keyWellLevel: null,
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: 18961.92,
    oilField: '0100100014000000002',
    actualXAxis: 0,
    designLongitude: null,
    wellFieldUnitName: 'dq',
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '调整井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: null,
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 13:22:40',
    structureLocation: null,
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: null,
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: null,
    terraceCode: '1',
    remark: '20240625更新国家中国为编码;20240411大庆批量修改甲方单位;',
    actualYAxis: 0,
    drllPurpose: null,
    wellType: '0300100002000000004',
    cityName: null,
    designYAxis: 47699.38,
    wellUwi: null,
    oilFieldName: '大庆油田',
    bushingElevation: null,
    wellId: '202312311531173070962870',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 13:22:40',
    countyName: null,
    wellTypeName: '定向井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000050',
    updateUser: 'From_DQ',
    traverseLineXAxis: null,
    userName: null,
    wellLegalName: null,
    oilFieldBlockName: '二厂南二区东部南块',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'NAN2-DING20-XIEP3032',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000000238',
    createUser: 'From_DQ',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202312181045202876403655',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: null,
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: '大庆萨尔图油田南二区东部位于萨尔图背斜构造东翼',
    province: null,
    terrainLandforms: null,
    jzh: null,
    wellName: '南2-2-P3036',
    horizontalLength: null,
    oilFieldBlock: '0300100011000008222',
    angleDip: -11.6,
    keyWellLevel: null,
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: '黑龙江省大庆市红岗区',
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: 21652313,
    oilField: '0100100014000000002',
    actualXAxis: 0,
    designLongitude: null,
    wellFieldUnitName: 'dq',
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '调整井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: null,
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 13:49:51',
    structureLocation: '大庆萨尔图油田南二区东部位于萨尔图背斜构造东翼',
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: null,
    meteoroData: null,
    magneticFieldintensity: 0,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: 0,
    keyWellLevelName: null,
    terraceCode: '0',
    remark: '20240625更新国家中国为编码;20240411大庆批量修改甲方单位;20240411大庆批量修改甲方单位;',
    actualYAxis: 0,
    drllPurpose: null,
    wellType: '0300100002000000001',
    cityName: null,
    designYAxis: 5158993,
    wellUwi: null,
    oilFieldName: '大庆油田',
    bushingElevation: 147.6,
    wellId: '202312181045202876403655',
    magneticDip: 3.5,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 13:49:51',
    countyName: null,
    wellTypeName: '直井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000050',
    updateUser: 'From_DQ',
    traverseLineXAxis: null,
    userName: null,
    wellLegalName: null,
    oilFieldBlockName: '二厂南二区东部南块',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'NAN2-2-P3036',
    wellctrlRiskLevel: null,
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000000238',
    createUser: 'From_DQ',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202401011503070357940289',
    everWellName: null,
    sectionNumber: null,
    county: '0200100002000001285',
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: '四级',
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: '140000',
    terrainLandforms: null,
    jzh: null,
    wellName: 'YC-GK-080',
    horizontalLength: null,
    oilFieldBlock: '0300100011000001269',
    angleDip: null,
    keyWellLevel: '0300100008000000005',
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: '1200200001000000007',
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: null,
    oilField: '0100100014140805226',
    actualXAxis: null,
    designLongitude: null,
    wellFieldUnitName: null,
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '采油井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: '山西省',
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 15:03:07',
    structureLocation: null,
    relativeSpace: null,
    updateDate: '2024-09-19 16:54:59',
    relativeWellName: null,
    city: '140500',
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: '正常',
    terraceCode: null,
    remark: null,
    actualYAxis: null,
    drllPurpose: null,
    wellType: '0300100002000000006',
    cityName: '晋城市',
    designYAxis: null,
    wellUwi: null,
    oilFieldName: '陕西博达石油工程技术服务有限公司',
    bushingElevation: null,
    wellId: '202401011503070357940289',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 15:03:07',
    countyName: '沁水县',
    wellTypeName: '定向井(丛式井)',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000011',
    updateUser: '8a7280cb5d121c3d015d2a157f0e4260',
    traverseLineXAxis: null,
    userName: '刘鑫',
    wellLegalName: null,
    oilFieldBlockName: '山西煤层气',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'YC-GK-080',
    wellctrlRiskLevel: '1200101002000000001',
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000001269',
    createUser: '8a7280cb5d121c3d015d2a157f0e4260',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'CN',
    bsflag: '0',
    wellboreId: '202401011509151867057712',
    everWellName: null,
    sectionNumber: null,
    county: '0200100002000001290',
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: '四级',
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: '150000',
    terrainLandforms: null,
    jzh: null,
    wellName: '苏5-20-43H',
    horizontalLength: null,
    oilFieldBlock: '0300100011000003356',
    angleDip: null,
    keyWellLevel: '0300100008000000005',
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: '1200200001000000007',
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: null,
    oilField: '0100100014140804885',
    actualXAxis: null,
    designLongitude: null,
    wellFieldUnitName: null,
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '采气井',
    oldWellYN: null,
    countryName: '中国',
    provinceName: '内蒙古自治区',
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 15:09:15',
    structureLocation: null,
    relativeSpace: null,
    updateDate: '2024-09-19 16:54:59',
    relativeWellName: null,
    city: '150600',
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: null,
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: '正常',
    terraceCode: null,
    remark: null,
    actualYAxis: null,
    drllPurpose: null,
    wellType: '0300100002000000001',
    cityName: '鄂尔多斯市',
    designYAxis: null,
    wellUwi: null,
    oilFieldName: '苏里格项目经理部',
    bushingElevation: null,
    wellId: '202401011509151867057712',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 15:09:15',
    countyName: '乌审旗',
    wellTypeName: '直井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000012',
    updateUser: '8a7280cb5d121c3d015d2a157f0e4260',
    traverseLineXAxis: null,
    userName: '刘鑫',
    wellLegalName: null,
    oilFieldBlockName: '苏里格油区',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'SU5-20-43H',
    wellctrlRiskLevel: '1200101002000000001',
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000003356',
    createUser: '8a7280cb5d121c3d015d2a157f0e4260',
    actualLongitude: null,
    wellLegalname: null
  },
  {
    country: 'IQ',
    bsflag: '0',
    wellboreId: '202401011616005514115803',
    everWellName: null,
    sectionNumber: null,
    county: null,
    mdmWellId: null,
    relativeAzimuth: null,
    wellctrlRiskLevelName: '四级',
    marketType: null,
    lockedIf: '0',
    traverseLineYAxis: null,
    structCode: null,
    province: null,
    terrainLandforms: null,
    jzh: null,
    wellName: 'WQ1-548',
    horizontalLength: null,
    oilFieldBlock: '0300100011000008184',
    angleDip: null,
    keyWellLevel: '无',
    designLatitude: null,
    casingTopDepth: null,
    geographPosition: null,
    specialWell: null,
    rtocKeyWellFlag: null,
    basin: null,
    designXAxis: 0,
    oilField: '0100100014140805911',
    actualXAxis: 0,
    designLongitude: null,
    wellFieldUnitName: null,
    twoDimPosition: null,
    designGroundElevation: null,
    wellSortName: '油气井',
    oldWellYN: null,
    countryName: '伊拉克',
    provinceName: null,
    actualGroundElevation: null,
    status: null,
    createDateShow: '2024-01-01 16:16:01',
    structureLocation: '无',
    relativeSpace: null,
    updateDate: '2024-09-19 16:42:18',
    relativeWellName: null,
    city: null,
    meteoroData: null,
    magneticFieldintensity: null,
    structureDescription: '无',
    outputType: null,
    seaWaterDepth: null,
    keyWellLevelName: null,
    terraceCode: null,
    remark: null,
    actualYAxis: 0,
    drllPurpose: null,
    wellType: '0300100002000000012',
    cityName: null,
    designYAxis: 0,
    wellUwi: null,
    oilFieldName: 'Exxon Mobil',
    bushingElevation: null,
    wellId: '202401011616005514115803',
    magneticDip: null,
    relatedTransactionYN: null,
    platformWellName: null,
    createDate: '2024-01-01 16:16:01',
    countyName: null,
    wellTypeName: '水平井',
    threeDimPosition: null,
    actualLatitude: null,
    dataFrom: null,
    wellSort: '0300100001000000069',
    updateUser: '679c4d53818548fbb534ebd96e4c2933',
    traverseLineXAxis: null,
    userName: null,
    wellLegalName: null,
    oilFieldBlockName: '待定',
    turnkeyProjectYN: null,
    jzxh: null,
    wellctrlRiskTypeName: null,
    wellEnName: 'WQ1-548',
    wellctrlRiskLevel: '1200101002000000001',
    wellctrlRiskType: null,
    wellBelongRegion: null,
    siteId: '0300100011000008184',
    createUser: '679c4d53818548fbb534ebd96e4c2933',
    actualLongitude: null,
    wellLegalname: null
  }
])
// 自定义验证函数
const validateLongitude = (rule, value, callback) => {
  if (value === null || value === '') {
    callback(new Error('经度是必填项'))
  } else if (value < -180 || value > 180) {
    callback(new Error('经度必须在 -180 到 180 之间'))
  } else {
    callback()
  }
}
const ESICValue = ref({})
const handleCurrentChange = (val: User | undefined) => {
  ESICValue.value = val
  clicks.value = true
  formData.value.wellId = ESICValue.value.wellId
  formData.value.wellName = ESICValue.value.wellName
  formData.value.wellType = ESICValue.value.wellTypeName
  formData.value.oilField = ESICValue.value.oilFieldName
  formData.value.longitude = ESICValue.value.designLongitude
  formData.value.latitude = ESICValue.value.designLatitude
  formData.value.contactPerson = ESICValue.value.userName
  formData.value.wellCategory = ESICValue.value.wellSortName
  formData.value.oilFieldBlock = ESICValue.value.oilFieldBlockName
  formData.value.designWellde = ESICValue.value.designWellde
  formData.value.contactPhone = ESICValue.value.contactPhone
  formData.value.remark = ESICValue.value.remark
  // formData.value.country = ESICValue.value.country
  // formData.value.province = ESICValue.value.provinceName
  // formData.value.city = ESICValue.value.cityName
  // formData.value.county = ESICValue.value.county
  dialogVisibleable.value = false
}
const validateLatitude = (rule, value, callback) => {
  if (value === null || value === '') {
    callback(new Error('纬度是必填项'))
  } else if (value < -90 || value > 90) {
    callback(new Error('纬度必须在 -90 到 90 之间'))
  } else {
    callback()
  }
}

const formRules = reactive({
  longitude: [{ required: true, trigger: 'blur', validator: validateLongitude }],
  latitude: [{ required: true, trigger: 'blur', validator: validateLatitude }]
})

const formRef = ref() // 表单 Ref

/** 打开弹窗 */
const open = async (type: string, id?: number) => {
  // 调用地区接口
  clicks.value = false
  addressDataTree.value = await SiteApi.getAreatest()
  dialogVisible.value = true
  dialogTitle.value = t('action.' + type)
  formType.value = type
  resetForm()
  // 修改时，设置数据
  if (id) {
    formLoading.value = true
    try {
      formData.value = await SiteApi.getSite(id)
      selectedAddress.value = [
        Number(formData.value.province),
        Number(formData.value.city),
        Number(formData.value.county)
      ]
    } finally {
      formLoading.value = false
    }
  }
}
defineExpose({ open }) // 提供 open 方法，用于打开弹窗
const getObtain = () => {
  dialogVisibleable.value = true
}
/** 提交表单 */
const emit = defineEmits(['success']) // 定义 success 事件，用于操作成功后的回调
const submitForm = async () => {
  // 校验表单
  await formRef.value.validate()
  // 提交请求
  formLoading.value = true
  if(clicks.value){
  formData.value.wellCategory = ESICValue.value.wellSort
  formData.value.oilFieldBlock = ESICValue.value.oilFieldBlock
  formData.value.wellType = ESICValue.value.wellType
  }
  try {
    const data = formData.value as unknown as SiteVO
    if (formType.value === 'create') {
      await SiteApi.createSite(data)
      message.success(t('common.createSuccess'))
    } else {
      await SiteApi.updateSite(data)
      message.success(t('common.updateSuccess'))
    }
    dialogVisible.value = false
    // 发送操作成功的事件
    emit('success')
  } finally {
    formLoading.value = false
  }
}

/** 重置表单 */
const resetForm = () => {
  formData.value = {
    id: undefined,
    wellId: undefined,
    wellName: undefined,
    wellType: undefined,
    wellCategory: undefined,
    oilField: undefined,
    oilFieldBlock: undefined,
    longitude: undefined,
    latitude: undefined,
    aimLayer: undefined,
    drillingDate: undefined,
    designWellde: undefined,
    drillingWellde: undefined,
    drillingLayer: undefined,
    welldeLithology: undefined,
    projectProfile: undefined,
    contactPerson: undefined,
    contactPhone: undefined,
    remark: undefined,
    state: undefined,
    country: undefined,
    province: undefined,
    city: undefined,
    county: undefined,
    addressId: undefined
  }
  selectedAddress.value = []
  formRef.value?.resetFields()
}

//所在位置地区树---------------------------------
// 树形结构
const addressDataTree = ref([])

const selectedAddress = ref([])
const addressChanges = (value) => {
  if (value.length === 3) {
    formData.value.province = value[0]
    formData.value.city = value[1]
    formData.value.county = value[2]
  } else {
    formData.value.province = ''
    formData.value.city = ''
    formData.value.county = ''
  }
}

//清空所在位置地区树级联选择器内容
const clearCascader = () => {
  addressDataTree.value = []
}
</script>
